import time
import unittest

from HTMLTestRunner import HTMLTestRunner
from selenium import webdriver

import model

from model.test_login import test_login
from model.test_creatleague import test_creatleague
from model.test_regist import register

from util.util import util

class testcase(unittest.TestCase):

    driver=webdriver.Firefox()
    driver.implicitly_wait(20)
    driver.maximize_window()

    def setUp(self):
        self.driver.get("https://dashboard-dev.zhigui.com/")
        assert self.driver.title, "bass"
        print("准备测试")
        time.sleep(2)

    @util.screenshot_error
    def test_case1(self):
        login=model.test_login.test_login(self)
        login
        time.sleep(2)
        creatleague=model.test_creatleague.test_creatleague(self)
        creatleague
        regist=model.test_regist.regist()
        regist
        # time.sleep(2)

    def tearDown(self):
        print("关闭网页")
        # self.driver.close()
        # self.driver.quit()

if __name__ == '__main__':
     unittest.main()
